package controllers.tinkerforge;

import java.util.ArrayList;

import models.NodeConfig;
import play.Logger;
import ch.bfh.abcm.rems.interfaces.tinkerforge.TFSensorDataPersister;
import ch.bfh.abcm.rems.sensors.tinkerforge.TFConfig;
import ch.bfh.abcm.rems.sensors.tinkerforge.TFSensorConfigDefinition;
import ch.bfh.abcm.rems.sensors.tinkerforge.TFSensorType;

public class REMSTFConfig extends TFConfig{

    public REMSTFConfig(TFSensorDataPersister dataPersister) {
        super(dataPersister);
    }

    @Override
    protected ArrayList<String> getMasterbrickIPs() {
        ArrayList<String> ips = new ArrayList<String>();
//        ips.add("localhost");        
        ips.add("192.168.10.31");        
        ips.add("192.168.10.32");        
        ips.add("192.168.10.33");        
        //CrapyHack
        crapyHack(ips);
        return ips;
    }

    private void crapyHack(ArrayList<String> ips) {
        NodeConfig.deleteAll();
        
//        new NodeConfig("TestNode1","192.168.10.12").save();
        
//        new NodeConfig("TestNode1","192.168.10.16").save();
//        new NodeConfig("TestNode1","192.168.10.10").save();
        
        new NodeConfig("TestNode1","192.168.10.11").save();
        new NodeConfig("TestNode2","192.168.10.12").save();
        new NodeConfig("TestNode3","192.168.10.14").save();
//        new NodeConfig("192.168.10.12").save();
//        new NodeConfig("192.168.10.14").save();
//        new NodeConfig("192.168.10.15").save();
    }

}
